#!/usr/bin/env node

const Koa = require('koa'),
      fakeAsync = require('./lib/task.js');

const app = new Koa();

app.use(async (ctx,next)=>{     //M-power-logger
  await next();

  console.log(`${ctx.method} ${ctx.path}`);
});

app.use(async (ctx,next)=>{     //M-hello
  ctx.body = 'hello world .' + await fakeAsync(2) + 'ms';
});



app.listen(8080);
